//
//  Star.h
//  popstar
//
//  Created by luyuhuang on 14/11/29.
//
//

#ifndef __popstar__Star__
#define __popstar__Star__

#include "coco2d-inl.h"
#include <string>

class Star : public Sprite
{
public:
    
    
    enum StarColor {RED, GREEN, YELLOW, PURPLE };
    
    static Star* create(StarColor color);
    
    
    
    Star();
    virtual ~Star();
    bool init();
    
    
    
    bool isSelected() {return _isSelected;}
    void setSelected(bool b){ _isSelected = b;}
    
    void  updatePosition();
    
    void setIndexPath(Point idx){_indexPath = idx;}
    Point getIndexPath(){return _indexPath;}
    
    void setDestPosition(Point idx) {_destPosition = idx;}
    Point getDestPosition() {return _destPosition;}
    
    StarColor getColor(){return _color;}
    void setColor(StarColor color){_color = color;}
    
//    void setPostion(Point point);
//    Point getPosition
    
  
public:
    static const int MOVE_SPEED = 4;
    static const int STARWIDTH = 48;
    static const int STARHIGHT = 48;
    
    
private:
     std::string getStarfile(int color);
    

private:
     
    
    bool _isSelected;
    
    StarColor _color;

    Point _indexPath;  //
    
    Point _destPosition; // 目标位置，用于星星位轩移动
    
    
    
    
};





#endif /* defined(__popstar__Star__) */
